<?php 
session_start();
?>
<?php 
include('../config.php'); 
include('../src/langs.php');

$file = $_POST['prodFile'];
$gid = $_POST['gid'];
$lang = $_POST['lang'];

if ($_GET['lang']) {
	$lang = $_GET['lang'];
}

if( $file != null ) {
    $path = "../".$PRODUCTS_PATH;

    if ( !($dp = opendir($path)) ) {
        die ( "Blad" );
    }
    
    ?>  
    <span style="color: #ffffff;">alalalalal</span>          
    <?php 
    $file = '../oferta/content/produkty/a01.xml';
        if( file_exists($file) ) {
            $xml = simplexml_load_file($file);            
            $nazwa = $xml -> nazwa;
            $foto = $xml -> foto;   
            if($xml -> opis['lang'] == $lang) {   
                $desc = $xml -> opis; 
            }
            if($xml -> short['lang'] == $lang) {   
                $short = $xml -> short; 
            }
            ?>
    <div class="productsDetails" >

                    <div class="name">
                    <h1><?php echo $nazwa ?></h1>
                    </div>                
                    <div class="linkMore">
                    <a onclick="showProducts('<?php echo $gid ?>','<?php echo $lang;?>');">&laquo;&nbsp;<?php echo $BACK;?></a>                  
                    </div>

                    <div class="short">
                    <?php echo $short ?>               
                    </div>

                    <div class="foto"><img src="<?php echo $path."foto/".$foto ?>" alt=""/></div>

                    <div class="desc">
                    <?php echo $desc ?>               
                    </div>
      </div>     
            <?php       
        } 
    ?>
    <?php
}
?>